package com.qdu.servlet;

import com.qdu.service.AdminService;
import com.qdu.service.impl.AdminServiceImpl;
import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
@WebServlet("/du")
public class DeleteUserServlet extends HttpServlet{
    AdminService as=new AdminServiceImpl();
    @Override
    protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        req.setCharacterEncoding("utf-8");
        //1. 获取请求参数
        //获取要删除的管理员的编号
        int Uno = Integer.parseInt(req.getParameter("Uno"));
        //2. 执行业务逻辑
        //根据编号从数据库删除管理员
        int rows =as.deleteUser(Uno);
         
        resp.getWriter().println(rows);
        
    }

    

    
}
